public class Rectangle {
    private double longth; // 矩形的长
    private double width;  // 矩形的宽
    //计算矩形的面积
    public double area(){
        return longth*width;
    }
    // 创建构造方法
    public Rectangle() {

    }
    public Rectangle(double longth, double width) {
        this.longth = longth;
        this.width = width;
    }

    // get，set方法
    public double getLongth() {
        return longth;
    }

    public void setLongth(double longth) {
        this.longth = longth;
    }

    public double getWidth() {
        return width;
    }

    public void setWidth(double width) {
        this.width = width;
    }
}
